<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>定位</title>
  <style>
    .father {
      width: 80vw;
      height: 50vw;
      border: 1px solid #000;
      position: relative;
    }

    .one {
      width: 20vw;
      height: 10vw;
      background-color: orange;
      /* 开启定位之后，该元素不再占位 */
      /* 默认以页面为参考标准，如果希望以父元素作为参考标准，则需要给父元素添加相对定位（子绝父相）*/
      position: absolute;
      top:50px;
      right: 10px;
      z-index: 1;
    }

    .two {
      width: 20vw;
      height: 10vw;
      background-color: green;
      position: absolute;
      right: 100px;
    }
  </style>
</head>
<body>
  <div class="father">
    <div class="one">one</div>
    <div class="two">two</div>
  </div>
</body>
</html>